def get_dict_from_cursor(cursor):
    fields = [field[0] for field in cursor.description]
    return [dict(zip(fields, row)) for row in cursor.fetchall()]